package com.flash.DayProcessing.service.impl;

import com.flash.DayProcessing.entity.SecurityMessage;
import com.flash.DayProcessing.mapper.SecurityMessageMapper;
import com.flash.DayProcessing.service.SecurityMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
/**
 * 这是证券的实现类
 * @author Liy
 * @since 2022-9-1
 * @version 1.0
 */
@Service
@Transactional
public class SecurityMessageServiceImpl implements SecurityMessageService {

    @Autowired
    SecurityMessageMapper securityMessageMapper;

    /**
     * 证券查询的方法
     * @param time 当为周六周日时，需要传入的时间条件
     * @param fundId 基金ID
     * @param dateStock 当前日期
     * @return 返回证券信息
     */
    @Override
    public List<SecurityMessage> selectSecrityMessage(String time, String fundId, String dateStock) {
        return securityMessageMapper.selectSecrityMessage(time,fundId,dateStock);
    }

    /**
     * 债券信息方法
     * @param dateStock 日期
     * @param fundId id
     * @param type 类型
     * @return 返回证券信息
     */
    @Override
    public List<SecurityMessage> selectDebentureInterestValueStatistics(String dateStock, String fundId, int type) {
        return securityMessageMapper.selectDebentureInterestValueStatistics(dateStock,fundId,type);
    }

    /**
     * 判断是流入还是流出
     * @param dateStock 日期
     * @param fundId id
     * @param type 类型
     * @param businessState 流入流出
     * @return
     */
    @Override
    public List<SecurityMessage> selectSecuritiesClearingValueStatistics(String dateStock, String fundId, int type, int businessState) {
        return securityMessageMapper.selectSecuritiesClearingValueStatistics(dateStock,fundId,type,businessState);
    }
}
